webpackJsonp([5],{

/***/ 291:
/***/ (function(module, exports, __webpack_require__) {

var disposed = false
function injectStyle (ssrContext) {
  if (disposed) return
  __webpack_require__(333)
}
var normalizeComponent = __webpack_require__(4)
/* script */
var __vue_script__ = __webpack_require__(335)
/* template */
var __vue_template__ = __webpack_require__(339)
/* template functional */
var __vue_template_functional__ = false
/* styles */
var __vue_styles__ = injectStyle
/* scopeId */
var __vue_scopeId__ = "data-v-4b78950c"
/* moduleIdentifier (server only) */
var __vue_module_identifier__ = null
var Component = normalizeComponent(
  __vue_script__,
  __vue_template__,
  __vue_template_functional__,
  __vue_styles__,
  __vue_scopeId__,
  __vue_module_identifier__
)
Component.options.__file = "resources/assets/js/views/cms/category/index.vue"

/* hot reload */
if (false) {(function () {
  var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
  hotAPI.install(require("vue"), false)
  if (!hotAPI.compatible) return
  module.hot.accept()
  if (!module.hot.data) {
    hotAPI.createRecord("data-v-4b78950c", Component.options)
  } else {
    hotAPI.reload("data-v-4b78950c", Component.options)
  }
  module.hot.dispose(function (data) {
    disposed = true
  })
})()}

module.exports = Component.exports


/***/ }),

/***/ 303:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _waves = __webpack_require__(304);

var _waves2 = _interopRequireDefault(_waves);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var install = function install(Vue) {
  Vue.directive('waves', _waves2.default);
};

if (window.Vue) {
  window.waves = _waves2.default;
  Vue.use(install); // eslint-disable-line
}

_waves2.default.install = install;
exports.default = _waves2.default;

/***/ }),

/***/ 304:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

__webpack_require__(305);

exports.default = {
  bind: function bind(el, binding) {
    el.addEventListener('click', function (e) {
      var customOpts = Object.assign({}, binding.value);
      var opts = Object.assign({
        ele: el, // 波纹作用元素
        type: 'hit', // hit 点击位置扩散 center中心点扩展
        color: 'rgba(0, 0, 0, 0.15)' // 波纹颜色
      }, customOpts);
      var target = opts.ele;
      if (target) {
        target.style.position = 'relative';
        target.style.overflow = 'hidden';
        var rect = target.getBoundingClientRect();
        var ripple = target.querySelector('.waves-ripple');
        if (!ripple) {
          ripple = document.createElement('span');
          ripple.className = 'waves-ripple';
          ripple.style.height = ripple.style.width = Math.max(rect.width, rect.height) + 'px';
          target.appendChild(ripple);
        } else {
          ripple.className = 'waves-ripple';
        }
        switch (opts.type) {
          case 'center':
            ripple.style.top = rect.height / 2 - ripple.offsetHeight / 2 + 'px';
            ripple.style.left = rect.width / 2 - ripple.offsetWidth / 2 + 'px';
            break;
          default:
            ripple.style.top = (e.pageY - rect.top - ripple.offsetHeight / 2 - document.documentElement.scrollTop || document.body.scrollTop) + 'px';
            ripple.style.left = (e.pageX - rect.left - ripple.offsetWidth / 2 - document.documentElement.scrollLeft || document.body.scrollLeft) + 'px';
        }
        ripple.style.backgroundColor = opts.color;
        ripple.className = 'waves-ripple z-active';
        return false;
      }
    }, false);
  }
};

/***/ }),

/***/ 305:
/***/ (function(module, exports, __webpack_require__) {

// style-loader: Adds some css to the DOM by adding a <style> tag

// load the styles
var content = __webpack_require__(306);
if(typeof content === 'string') content = [[module.i, content, '']];
// Prepare cssTransformation
var transform;

var options = {}
options.transform = transform
// add the styles to the DOM
var update = __webpack_require__(98)(content, options);
if(content.locals) module.exports = content.locals;
// Hot Module Replacement
if(false) {
	// When the styles change, update the <style> tags
	if(!content.locals) {
		module.hot.accept("!!../../../../../node_modules/_css-loader@0.28.11@css-loader/index.js!./waves.css", function() {
			var newContent = require("!!../../../../../node_modules/_css-loader@0.28.11@css-loader/index.js!./waves.css");
			if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
			update(newContent);
		});
	}
	// When the module is disposed, remove the <style> tags
	module.hot.dispose(function() { update(); });
}

/***/ }),

/***/ 306:
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(6)(false);
// imports


// module
exports.push([module.i, ".waves-ripple {\n    position: absolute;\n    border-radius: 100%;\n    background-color: rgba(0, 0, 0, 0.15);\n    background-clip: padding-box;\n    pointer-events: none;\n    -webkit-user-select: none;\n    -moz-user-select: none;\n    -ms-user-select: none;\n    user-select: none;\n    -webkit-transform: scale(0);\n    -ms-transform: scale(0);\n    transform: scale(0);\n    opacity: 1;\n}\n\n.waves-ripple.z-active {\n    opacity: 0;\n    -webkit-transform: scale(2);\n    -ms-transform: scale(2);\n    transform: scale(2);\n    -webkit-transition: opacity 1.2s ease-out, -webkit-transform 0.6s ease-out;\n    transition: opacity 1.2s ease-out, -webkit-transform 0.6s ease-out;\n    transition: opacity 1.2s ease-out, transform 0.6s ease-out;\n    transition: opacity 1.2s ease-out, transform 0.6s ease-out, -webkit-transform 0.6s ease-out;\n}", ""]);

// exports


/***/ }),

/***/ 333:
/***/ (function(module, exports, __webpack_require__) {

// style-loader: Adds some css to the DOM by adding a <style> tag

// load the styles
var content = __webpack_require__(334);
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add the styles to the DOM
var update = __webpack_require__(8)("17512140", content, false, {});
// Hot Module Replacement
if(false) {
 // When the styles change, update the <style> tags
 if(!content.locals) {
   module.hot.accept("!!../../../../../../node_modules/_css-loader@0.28.11@css-loader/index.js!../../../../../../node_modules/_vue-loader@13.7.3@vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-4b78950c\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../node_modules/_sass-loader@6.0.7@sass-loader/lib/loader.js!../../../../../../node_modules/_vue-loader@13.7.3@vue-loader/lib/selector.js?type=styles&index=0!./index.vue", function() {
     var newContent = require("!!../../../../../../node_modules/_css-loader@0.28.11@css-loader/index.js!../../../../../../node_modules/_vue-loader@13.7.3@vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-4b78950c\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../node_modules/_sass-loader@6.0.7@sass-loader/lib/loader.js!../../../../../../node_modules/_vue-loader@13.7.3@vue-loader/lib/selector.js?type=styles&index=0!./index.vue");
     if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
     update(newContent);
   });
 }
 // When the module is disposed, remove the <style> tags
 module.hot.dispose(function() { update(); });
}

/***/ }),

/***/ 334:
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(6)(false);
// imports


// module
exports.push([module.i, "\n.custom-tree-node[data-v-4b78950c] {\n  -webkit-box-flex: 1;\n      -ms-flex: 1;\n          flex: 1;\n  display: -webkit-box;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-align: center;\n      -ms-flex-align: center;\n          align-items: center;\n  -webkit-box-pack: justify;\n      -ms-flex-pack: justify;\n          justify-content: space-between;\n  font-size: 14px;\n  padding-right: 8%;\n}\n.select[data-v-4b78950c] {\n  font-siz: 20px;\n  color: #1e90ff;\n}\n.custom-tree-node[data-v-4b78950c] {\n  padding-right: 0;\n}\n", ""]);

// exports


/***/ }),

/***/ 335:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _dialog2 = __webpack_require__(336);

var _dialog3 = _interopRequireDefault(_dialog2);

var _waves = __webpack_require__(303);

var _waves2 = _interopRequireDefault(_waves);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// Waves directive
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

exports.default = {
    name: 'admin',
    components: {
        'el-dialog': _dialog3.default
    },
    directives: { waves: _waves2.default },
    data: function data() {
        return {
            stateManager: {
                refreshList: true,
                editDialogVisible: false,
                editModelId: null,
                parentId: 0,
                listLoading: true,
                buttonLoading: false
            },
            query: {
                keyword: '',
                page: 1
            },
            list: [],
            model: this.$modelDataSource({
                url: '/api/cms/category',
                dataKey: 'model',
                attributes: {
                    id: ''
                }
            }),
            currentPage: 1
        };
    },
    created: function created() {
        this.$store.commit('setPageTitle', '栏目管理');
    },

    methods: {
        showEditDialog: function showEditDialog(id) {
            this.stateManager.editDialogVisible = true;
            this.stateManager.editModelId = id;
        },
        showAddDialog: function showAddDialog(data) {
            this.stateManager.parentId = data.id;
            this.stateManager.editDialogVisible = true;
            this.stateManager.editModelId = 0;
        },
        fetchList: function fetchList(params, callback) {
            axios.get('/api/cms/category', { params: params }).then(function (res) {
                callback(res);
            });
        },
        handleFilter: function handleFilter() {
            this.query.page = 1;
            this.stateManager.refreshList = true;
        },

        // 翻页
        handleCurrentChange: function handleCurrentChange(val) {
            this.currentPage = val;
            this.query.page = val;
            this.stateManager.refreshList = true;
        },
        handleDelete: function handleDelete(id) {
            var self = this;
            this.$confirm('是否删除此项？', {
                confirmButtonText: '确认',
                cancelButtonText: '取消',
                type: 'warning',
                title: '删除确认'
            }).then(function () {
                self.model.uuid = id;
                self.model.destroy(function () {
                    self.stateManager.refreshList = true;
                    self.$message.success('删除成功');
                });
            }).catch(function (res) {
                console.log(res.response);
            });
        }
    },
    computed: {
        tableList: function tableList() {
            var _this = this;

            var self = this;
            if (this.stateManager.refreshList) {
                this.stateManager.listLoading = true;
                this.fetchList(self.query, function (res) {
                    _this.list = res.data;
                    _this.stateManager.refreshList = false;
                });
            }
            return this.list;
        }
    }
};

/***/ }),

/***/ 336:
/***/ (function(module, exports, __webpack_require__) {

var disposed = false
var normalizeComponent = __webpack_require__(4)
/* script */
var __vue_script__ = __webpack_require__(337)
/* template */
var __vue_template__ = __webpack_require__(338)
/* template functional */
var __vue_template_functional__ = false
/* styles */
var __vue_styles__ = null
/* scopeId */
var __vue_scopeId__ = null
/* moduleIdentifier (server only) */
var __vue_module_identifier__ = null
var Component = normalizeComponent(
  __vue_script__,
  __vue_template__,
  __vue_template_functional__,
  __vue_styles__,
  __vue_scopeId__,
  __vue_module_identifier__
)
Component.options.__file = "resources/assets/js/views/cms/category/_dialog.vue"

/* hot reload */
if (false) {(function () {
  var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
  hotAPI.install(require("vue"), false)
  if (!hotAPI.compatible) return
  module.hot.accept()
  if (!module.hot.data) {
    hotAPI.createRecord("data-v-355d308f", Component.options)
  } else {
    hotAPI.reload("data-v-355d308f", Component.options)
  }
  module.hot.dispose(function (data) {
    disposed = true
  })
})()}

module.exports = Component.exports


/***/ }),

/***/ 337:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; //
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

var _vuex = __webpack_require__(38);

exports.default = {
  props: {
    stateManager: {
      type: Object
    }
  },
  data: function data() {
    return {
      model: this.$modelDataSource({
        url: '/api/cms/category',
        dataKey: 'model',
        attributes: {
          id: 0,
          name: '',
          parent_id: 0
        }
      }),
      isLoading: false,
      ruleValidate: {
        name: [{ required: true, message: '请填写栏目名称', trigger: 'blur' }]
      }
    };
  },
  methods: {
    closeDialog: function closeDialog() {
      if (this.stateManager.buttonLoading) {
        return false;
      }
      this.stateManager.editDialogVisible = false;
      this.stateManager.listLoading = false;
      this.model.reset();
      this.$refs['model'].resetFields();
      this.stateManager.editModelId = 0;
    },
    saveModel: function saveModel() {
      var self = this;
      self.$refs['model'].validate(function (valid) {
        if (valid) {
          if (self.stateManager.editModelId == 0) {
            self.model.parent_id = self.stateManager.parentId;
          }
          self.isLoading = false;
          self.stateManager.buttonLoading = true;
          self.model.save(function () {
            self.$message.success('保存成功');
            self.stateManager.refreshList = true;
            self.stateManager.buttonLoading = false;
            self.closeDialog();
          }, function (errors) {
            self.stateManager.buttonLoading = false;
            self.isLoading = false;
          });
        } else {
          console.log('表单验证失败');
        }
      });
    }
  },
  computed: _extends({}, (0, _vuex.mapGetters)(['rolesList']), {
    modalTitle: function modalTitle() {
      switch (this.stateManager.editModelId) {
        case 0:
          return '添加栏目';
          break;
        default:
          return '编辑栏目';
      }
    }
  }),
  watch: {
    'stateManager.editModelId': function stateManagerEditModelId(newValue) {
      var self = this;
      this.model.fetch(newValue, { include: 'update' }, function () {
        self.stateManager.editDialogVisible = true;
      }, function () {
        self.stateManager.listLoading = false;
      });
    }
  }
};

/***/ }),

/***/ 338:
/***/ (function(module, exports, __webpack_require__) {

var render = function() {
  var _vm = this
  var _h = _vm.$createElement
  var _c = _vm._self._c || _h
  return _c(
    "div",
    { attrs: { id: "create-edit-container" } },
    [
      _c(
        "el-drawer",
        {
          ref: "drawer",
          attrs: {
            direction: "rtl",
            visible: _vm.stateManager.editDialogVisible,
            title: _vm.modalTitle,
            "custom-class": "demo-drawer",
            "before-close": _vm.closeDialog
          },
          on: {
            "update:visible": function($event) {
              return _vm.$set(_vm.stateManager, "editDialogVisible", $event)
            }
          }
        },
        [
          _c(
            "div",
            { staticClass: "dialog-drawer-content" },
            [
              _c(
                "el-form",
                {
                  ref: "model",
                  attrs: { model: _vm.model, rules: _vm.ruleValidate }
                },
                [
                  _c(
                    "el-row",
                    { attrs: { type: "flex", gutter: 20 } },
                    [
                      _c(
                        "el-col",
                        { attrs: { span: 24 } },
                        [
                          _c(
                            "el-form-item",
                            { attrs: { label: "栏目名称", prop: "name" } },
                            [
                              _c("el-input", {
                                attrs: { placeholder: "请填写栏目名称" },
                                model: {
                                  value: _vm.model.name,
                                  callback: function($$v) {
                                    _vm.$set(_vm.model, "name", $$v)
                                  },
                                  expression: "model.name"
                                }
                              })
                            ],
                            1
                          )
                        ],
                        1
                      )
                    ],
                    1
                  )
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "div",
                { staticClass: "dialog-drawer-footer" },
                [
                  _c(
                    "el-button",
                    {
                      attrs: { type: "ghost" },
                      on: { click: _vm.closeDialog }
                    },
                    [_vm._v("取消")]
                  ),
                  _vm._v(" "),
                  _c(
                    "el-button",
                    {
                      attrs: {
                        type: "primary",
                        loading: _vm.stateManager.buttonLoading
                      },
                      on: { click: _vm.saveModel }
                    },
                    [
                      _vm._v(
                        _vm._s(
                          _vm.stateManager.buttonLoading ? "提交中" : "确定"
                        )
                      )
                    ]
                  )
                ],
                1
              )
            ],
            1
          )
        ]
      )
    ],
    1
  )
}
var staticRenderFns = []
render._withStripped = true
module.exports = { render: render, staticRenderFns: staticRenderFns }
if (false) {
  module.hot.accept()
  if (module.hot.data) {
    require("vue-loader/node_modules/vue-hot-reload-api")      .rerender("data-v-355d308f", module.exports)
  }
}

/***/ }),

/***/ 339:
/***/ (function(module, exports, __webpack_require__) {

var render = function() {
  var _vm = this
  var _h = _vm.$createElement
  var _c = _vm._self._c || _h
  return _c(
    "div",
    { staticClass: "app-container" },
    [
      _c(
        "div",
        { staticClass: "filter-container" },
        [
          _c("el-input", {
            staticClass: "filter-item",
            staticStyle: { width: "260px" },
            attrs: { placeholder: "请输入查询信息" },
            nativeOn: {
              keyup: function($event) {
                if (
                  !$event.type.indexOf("key") &&
                  _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
                ) {
                  return null
                }
                return _vm.handleFilter($event)
              }
            },
            model: {
              value: _vm.query.keyword,
              callback: function($$v) {
                _vm.$set(_vm.query, "keyword", $$v)
              },
              expression: "query.keyword"
            }
          }),
          _vm._v(" "),
          _c(
            "el-button",
            {
              directives: [{ name: "waves", rawName: "v-waves" }],
              staticClass: "filter-item",
              attrs: { type: "primary", icon: "el-icon-search" },
              on: { click: _vm.handleFilter }
            },
            [_vm._v("查询\n        ")]
          ),
          _vm._v(" "),
          _c(
            "el-button",
            {
              staticClass: "filter-item",
              staticStyle: { "margin-left": "0" },
              attrs: { type: "primary", icon: "el-icon-edit" },
              on: {
                click: function($event) {
                  return _vm.showEditDialog(0)
                }
              }
            },
            [_vm._v(" 添加\n        ")]
          )
        ],
        1
      ),
      _vm._v(" "),
      [
        _c(
          "el-table",
          {
            staticStyle: { width: "100%", "margin-bottom": "20px" },
            attrs: {
              data: _vm.tableList,
              "row-key": "id",
              border: "",
              fit: "",
              "highlight-current-row": "",
              "default-expand-all": "",
              "tree-props": { children: "children", hasChildren: "hasChildren" }
            }
          },
          [
            _c("el-table-column", {
              attrs: { prop: "name", label: "栏目名称" }
            }),
            _vm._v(" "),
            _c("el-table-column", {
              attrs: { label: "操作", width: "200", align: "left" },
              scopedSlots: _vm._u([
                {
                  key: "default",
                  fn: function(scope) {
                    return [
                      _c("el-button", {
                        attrs: {
                          size: "mini",
                          type: "info",
                          icon: "el-icon-circle-plus-outline"
                        },
                        on: {
                          click: function($event) {
                            return _vm.showAddDialog(scope.row)
                          }
                        }
                      }),
                      _vm._v(" "),
                      _c("el-button", {
                        attrs: {
                          size: "mini",
                          type: "success",
                          icon: "el-icon-edit-outline"
                        },
                        on: {
                          click: function($event) {
                            return _vm.showEditDialog(scope.row.id)
                          }
                        }
                      }),
                      _vm._v(" "),
                      _c("el-button", {
                        attrs: {
                          size: "mini",
                          type: "danger",
                          icon: "el-icon-delete"
                        },
                        on: {
                          click: function($event) {
                            return _vm.handleDelete(scope.row.id)
                          }
                        }
                      })
                    ]
                  }
                }
              ])
            })
          ],
          1
        )
      ],
      _vm._v(" "),
      _c("el-dialog", { attrs: { stateManager: _vm.stateManager } })
    ],
    2
  )
}
var staticRenderFns = []
render._withStripped = true
module.exports = { render: render, staticRenderFns: staticRenderFns }
if (false) {
  module.hot.accept()
  if (module.hot.data) {
    require("vue-loader/node_modules/vue-hot-reload-api")      .rerender("data-v-4b78950c", module.exports)
  }
}

/***/ })

});